package homework_five_2;

public class HourlyEmployee extends ColEmployee {
    private int hour;
    private double hoursalary;

    public HourlyEmployee(String name, int birthdaymonth, int hour, double hoursalary) {
        super(name, birthdaymonth);
        this.hour = hour;
        this.hoursalary = hoursalary;
    }

    public double getSalary(int month) {
        double salray;
        if (hour > 160) {
            salray = 160 * hoursalary + (hour - 160) * 1.5 * hoursalary;
        } else {
            salray = hour * hoursalary;
        }
        if (getBirthdaymonth() == month) {
            salray += 100;
        }
        return salray;
    }

    public double getHoursalary() {
        return hoursalary;
    }

    public void setHoursalary(double hoursalary) {
        this.hoursalary = hoursalary;
    }

    public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        this.hour = hour;
    }

    public String getJob(){
        return " HourlyEmployee";
    }
}
